package com.bojiu.lawsearch.lawsearch.task;

import com.bojiu.lawsearch.lawsearch.model.OrderMessage;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.DelayQueue;

/**
 * @author: afdiao
 * @Date：2020/3/24 15:17
 * @Description:
 */
@AllArgsConstructor
@Slf4j
public class ThreadTask implements Runnable{

    private DelayQueue<OrderMessage> orderMessages;

    @Override
    public void run() {
        while (true) {
            try {
                OrderMessage take = orderMessages.take();
                log.debug("开始处理过期问题，id is :{}", orderMessages);
            } catch (Exception e) {
                log.error("error to handel task,error is :{}",e);
            }
        }
    }
}
